package www.ld.com.domain.roles.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import www.ld.com.core.group.InsertGroup;
import www.ld.com.core.group.UpdateGroup;
import www.ld.com.dictionary.UseStatusEnum;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

@Data
@ToString
@EqualsAndHashCode
@Accessors(chain = true)
public class InRolesVO {
    @ApiModelProperty("角色名称")
    @NotBlank(message = "角色名称不能为空",groups = {UpdateGroup.class})
    @Length(max = 20,min = 2,message = "角色名称必须是{min}~{max}个字符" ,groups = {UpdateGroup.class, InsertGroup.class} )
    private String name;
    @ApiModelProperty("角色ID")
    @NotBlank(message = "角色ID不能为空",groups = UpdateGroup.class)
    private String id;
    @ApiModelProperty("排序")
    @Range( max = 100,message = "排序不能大于{max}" ,groups = {UpdateGroup.class, InsertGroup.class} )
    private Integer sort;
    @Length(max = 255, message = "备注不能大于{max}个字符",groups = {UpdateGroup.class, InsertGroup.class}  )
    @ApiModelProperty("备注")
    private String remarks;
    @NotNull(message = "角色状态不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    @ApiModelProperty("角色状态")
    private UseStatusEnum status;
    @ApiModelProperty("授权集合")
    private List<String> resources;

}
